package biz.datalk.industrialland.admin.modules.common.servie;

import biz.datalk.industrialland.admin.modules.online.dynform.pojo.dto.DictItem;
import biz.datalk.industrialland.admin.modules.online.dynform.pojo.po.DynformField;
import biz.datalk.industrialland.admin.modules.online.dynform.pojo.po.DynformHead;

import java.util.List;
import java.util.Map;

/**
 * @author tarofang@163.com
 * @date 2019-12-19
 */
public interface ICommonService {

    long getCountForJdbc(String sql);
    long getCountForJdbc(String sql, Object... objs);

    List<Map<String, Object>> findForJdbc(String sql);
    List<Map<String, Object>> findForJdbc(String sql, Object... objs);

    Map<String, Object> findOneForJdbc(String sql);
    Map<String, Object> findOneForJdbc(String sql, Object... objs);

    int update(String sql);
    int update(String sql, Object... objs);

    /**
     * 判定表是否存在
     *
     * @author       tarofang@163.com
     * @date         2019-12-19
     *
     * @param tableName 表名
     * @return true-表存在 false-表不存在
     */
    boolean judgeTableIsExit(String tableName);

    void createTable(DynformHead table, List<DynformField> fields);

    List<DictItem> selectDictFromCustomTable(String dictTable, String dictCode, String dictText);

    List<DictItem> selectDictFromSysdict(String dictCode);
}
